package com.littlec.sdk.entity.messagebody;

import java.io.File;

import android.os.Parcel;
import android.os.Parcelable;

public class FileMessageBody extends MessageBody implements Parcelable {
	protected String fileName;
	protected long fileLength = -1L;
	protected String localPath;
	protected String originalUri;
	public static final Parcelable.Creator<FileMessageBody> CREATOR = new Parcelable.Creator() {
		public FileMessageBody createFromParcel(Parcel paramAnonymousParcel) {
			return new FileMessageBody(paramAnonymousParcel);
		}

		public FileMessageBody[] newArray(int paramAnonymousInt) {
			return new FileMessageBody[paramAnonymousInt];
		}
	};

	private FileMessageBody(Parcel paramParcel) {
		this.localPath = paramParcel.readString();
		this.fileName = paramParcel.readString();
		this.fileLength = paramParcel.readLong();
		this.originalUri = paramParcel.readString();
	}

	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(this.localPath);
		dest.writeString(this.fileName);
		dest.writeLong(this.fileLength);
		dest.writeString(this.originalUri);
	}

	public FileMessageBody() {
	}

	public FileMessageBody(String name, long fileLength, String uri) {
		this.fileName = name;
		this.fileLength = fileLength;
		this.originalUri = uri;
	}

	public FileMessageBody(File paramFile) {
		if (paramFile != null) {
			this.fileName = paramFile.getName();
			this.fileLength = paramFile.length();
			this.localPath = paramFile.getAbsolutePath();
		}
	}

	public String getFileName() {
		return this.fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public long getFileLength() {
		return this.fileLength;
	}

	public void setFileLength(long fileLength) {
		this.fileLength = fileLength;
	}

	public String getLocalPath() {
		return this.localPath;
	}

	public void setLocalPath(String localPath) {
		this.localPath = localPath;
	}

	public String getOriginalUri() {
		return this.originalUri;
	}

	public void setOriginalUri(String originalUri) {
		this.originalUri = originalUri;
	}

	public String getContent() {
		return getLocalPath();
	}

	public int describeContents() {
		return 0;
	}
}